package javabase.schoolwork.day6_12;

import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;

/**
 * @author fance
 * @date 18-6-13 下午12:43
 */
public class HomeWork {
    public static void main(String[] args) throws IOException {
       /* Random random = new Random(47);
        Set<Integer> set = new HashSet<>();
        while (true) {
            if (set.size() == 10) {
                break;
            }
            int cur = (random.nextInt(50) + 1);
            if (cur % 2 == 0) {
                set.add(cur);
            }

        }

        List<Integer> list = new ArrayList<>(set);

        Collections.sort(list, (o1, o2) -> o2 - o1);

        OutputStream outputStream = new FileOutputStream(new File("src/javabase/schoolwork/day6_12/num.txt"));
        for (Integer integer : list) {
            System.out.print(integer + " ");
            outputStream.write(integer);
        }*/


        List<String> list = new ArrayList<>();
        list.add("a");
        list.add("b");
        list.add("c");
        List<String> list2 = new ArrayList<>();
        list2.addAll(list);
        list2.add("b");
        list2.add("c");
        list2.add("d");
        Set<String> set = new HashSet<>(list2);
        for (String s : set) {
            System.out.println(s);
        }
    }
}
